//
//  DCWBaseRequest.h
//  Meng800
//
//  Created by 姚宗超 on 14/7/19.
//  Copyright (c) 2014年 点财网. All rights reserved.
//

#import <Foundation/Foundation.h>

@class MPError;

typedef NS_ENUM(NSUInteger, MPHttpRequestCachePolicy)
{
    MPRequestCacheAndServer = 0,
    MPRequestCacheOnly,
    MPRequestServerOnly
};

// errorNum －1表示网络错误, 0表示成功，其它数据表示接口错误代码
typedef void (^MPRequestComplete)(NSInteger errorNum, NSDictionary *info, MPError* errorMsg);
typedef void (^MPDataLoaderUploadProgressBlock)(long long size, long long total);
typedef void (^MPProgressBlock)(double progress);
typedef void (^MPDataComplete)(NSInteger errorNum, NSArray* data, MPError* errorMsg);

@interface MPHttpRequest : NSObject

/**
 *发送请求
 */

-(void)sendPostRequestWithMethod:(NSString*)method
                           param:(NSDictionary*)param
                      onComplete:(MPRequestComplete) requestComplete;

-(void)sendGetRequestWithMethod:(NSString*)method
                          param:(NSDictionary*)param
                     onComplete:(MPRequestComplete) requestComplete;

-(void)sendRequestWithParam:(NSDictionary*)param
                        url:(NSString*)urlPath
                  postOrGet:(NSString*)postOrGet
                 onComplete:(MPRequestComplete)requestComplete;

@end
